package com.sts.source.model;

import com.sts.source.StsSource;
import com.sts.source.impl.ExcelSourceImpl;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Setter
@Getter
public class ExcelSourceConfig extends BaseSourceConfig {

    private String filePath;
    private String sheetName;

    // 文件有头
    public ExcelSourceConfig(String filePath) {
        this.filePath = filePath;
    }

    public ExcelSourceConfig(String filePath, String sheetName) {
        this.filePath = filePath;
        this.sheetName = sheetName;
    }

    // 文件没有头
    public ExcelSourceConfig(boolean hasHeader, List<String> headerList, String filePath) {
        super(hasHeader, headerList);
        this.filePath = filePath;
    }

    public ExcelSourceConfig(boolean hasHeader, List<String> headerList, String filePath, String sheetName) {
        super(hasHeader, headerList);
        this.filePath = filePath;
        this.sheetName = sheetName;
    }

    @Override
    public StsSource buildImpl() {
        return new ExcelSourceImpl(this);
    }
}
